|
|
|
|
|
|
|
Consider the following code: |
|
|
|
|
|
|
|
|
Dim dt As Date
dt = "01/01/00"
Debug.Print "Date is " & FormatDateTime(dt, vbLongDate) |
|
|
|
|
|
|
|
|
The actual date stored in the variable is for the year 2000. From a programmer's standpoint, a decision must be made as to whether it is appropriate to continue to allow users to enter two digits for the year. If so, your program must include appropriate logic to convert the two digits to the correct year. In some cases, acceptance of two-digit years may no longer be acceptable, and users must learn to accept that fact. |
|
|
|
|
|
|
|
|
In any case, with a little planning and added logic in your programs, you should be able to proudly state that your own Visual Basic applications are year-2000 compliant. |
|
|
|
|
|
|
|
|
This chapter provided you with an overview of programming in Visual Basic. You learned the fundamentals of creating code statements, as well as how to handle and format various types of information. For some more material on programming, refer to the following chapters: |
|
|
|
|
|
|
|
|
To learn how to control the flow of your program code and how it can make decisions, see Chapter 10, "Controlling the Flow of Your Program Code." |
|
|
|
|
|
|
|
|
To learn how to create your own functions, see Chapter 11, "Managing Your Project: Sub Procedures, and Functions, and Multiple Forms." |
|
|
|
|
|
|
|
|
To find out how to write a sharp-looking interface, see Chapter 18, "Proper Interface Design." |
|
|
|
|
|